{{extend "layout_auth.html"}}

{{block content}}
<div class="row">
    <div class="col-lg-8 col-lg-offset-2">
        
        <div class="login-panel panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">修改资料</h3>
            </div>
            <ul class="nav nav-tabs upload-tabs">
                <li class="active" id="change-profile-li"><a href="#change-profile-tab" data-toggle="tab">修改基本信息</a></li>
                <li id="change-passwd-li"><a href="#change-passwd-tab" data-toggle="tab">修改密码</a></li>
            </ul>
            <form class="form-horizontal">            
                <div class="tab-content panel-body">
                    <div class="tab-pane active col-lg-8 col-lg-offset-2" id="change-profile-tab">
                        <br/>
                        <div class="form-group">
                            <label  class="col-lg-3 control-label">真实姓名</label>
                            <div class="col-lg-9">
                                <input cj-required cj-range="[1,16]" class="form-control cj-validator" placeholder="真实姓名" id="txt-realname" cj-name="真实姓名" type="text" value="{{=realname}}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label  class="col-lg-3 control-label">电子邮箱</label>
                            <div class="col-lg-9">
                                <input cj-email class="form-control cj-profile-validator" id="txt-email" placeholder="电子邮箱" name="txt-email"  cj-name="电子邮箱" type="text" value="{{=email}}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">手机号</label>
                            <div class="col-lg-9">
                            <input cj-telephone class="form-control cj-profile-validator" id="txt-telephone" placeholder="手机号" name="txt-telephone" cj-name="手机号" type="text" cj-name="手机号" value="{{=telephone}}">
                            </div>
                        </div>
                        <button class="btn btn-success col-lg-5" id="btn-change-profile" type="button">提交</button>
                        <button class="btn btn-success col-lg-5 col-lg-offset-2 btn-back" type="button">返回</button>
                    </div>
                    <div class="tab-pane col-lg-8 col-lg-offset-2" id="change-passwd-tab">
                        <br/>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">原始密码</label>
                            <div class="col-lg-9">
                            <input cj-required class="form-control cj-passwd-validator txt-passwd " id="txt-old-passwd" placeholder="原始密码"  cj-name="原始密码" type="password" value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">新密码</label>
                            <div class="col-lg-9">
                            <input cj-required cj-range="[6,16]"  class="form-control cj-passwd-validator txt-passwd" id="txt-new-passwd" placeholder="新密码" cj-name="新密码" type="password" value="">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">重复新密码</label>
                            <div class="col-lg-9">
                            <input cj-required cj-range="[6,16]"  class="form-control cj-passwd-validator txt-passwd" id="txt-repeat-new-passwd" placeholder="重复新密码" cj-name="重复新密码" type="password" value="">
                            </div>
                        </div>
                        
                        <button class="btn btn-success col-lg-5" id="btn-change-passwd" type="button">提交</button>
                        <button class="btn btn-success col-lg-5 col-lg-offset-2 btn-back" type="button">返回</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{{end}}

{{block js}}
<script src="{{=url_for_static('chujue-js/chujue_validate.js')}}"></script>
<script src="{{=url_for_static('chujue-js/chujue_ajax.js')}}"></script>
<script src="{{=url_for_static('MD5.js')}}"></script>
<script src="{{=url_for_static('views_auth/profile.js')}}"></script>

<script type="text/javascript">
    $(function() {
        $("#btn-change-profile").click(change_profile);
        $("#btn-change-passwd").click(change_passwd);
        $(".btn-back").click(function(){
            location.href = "/";
        });
        //清除提示标签
        $("#change-passwd-li").click(function() {
            var profile_pop = $(".cj-profile-validator");
            profile_pop.removeAttr("data-container");
            profile_pop.removeAttr("data-placement");
            profile_pop.removeAttr("data-content");
            profile_pop.removeAttr("style");
            profile_pop.popover("destroy");
        });
        
        //清除提示标签
        $("#change-profile-li").click(function() {
            var passwd_pop = $(".cj-passwd-validator");
            passwd_pop.removeAttr("data-container");
            passwd_pop.removeAttr("data-placement");
            passwd_pop.removeAttr("data-content");
            passwd_pop.removeAttr("style");
            passwd_pop.popover("destroy");
        });
    });
</script>
{{end}}
